package cn.backpackerxl.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.util.Objects;

/**
 * @author: backpackerxl
 * @create: 2021/12/8
 * @filename: Student
 **/

@Data
public class Student {
    @ExcelIgnore
    private int id;
    @ExcelProperty("学号")
    private String stuId;
    @ExcelProperty("姓名")
    private String name;
    @ExcelProperty("性别")
    private String sex;
    @ExcelProperty("年龄")
    private int age;
    @ExcelProperty("身高")
    private int height;
    @ExcelProperty("体重")
    private int weight;
    @ExcelProperty("爱好")
    private String hobby;

    public Student() {
    }

    public Student(int id, String stuId, String name, String sex, int age, int height, int weight, String hobby) {
        this.id = id;
        this.stuId = stuId;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.height = height;
        this.weight = weight;
        this.hobby = hobby;
    }

    public Student(String stuId, String name, String sex, int age, int height, int weight, String hobby) {
        this.stuId = stuId;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.height = height;
        this.weight = weight;
        this.hobby = hobby;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getStuId() {
        return stuId;
    }

    public void setStuId(String stuId) {
        this.stuId = stuId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSex() {
        return sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return id == student.id && age == student.age && height == student.height && weight == student.weight && Objects.equals(stuId, student.stuId) && Objects.equals(name, student.name) && Objects.equals(sex, student.sex) && Objects.equals(hobby, student.hobby);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, stuId, name, sex, age, height, weight, hobby);
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", stuId='" + stuId + '\'' +
                ", name='" + name + '\'' +
                ", sex=" + sex +
                ", age=" + age +
                ", height=" + height +
                ", weight=" + weight +
                ", hobby='" + hobby + '\'' +
                '}';
    }
}
